'use strict';

const { Service } = require('egg');

class RoleService extends Service {
  async getRoleList() {
    const { ctx, app } = this;
    const db = app.mysql.get('spring');
    // let result = await db.query('select * from t_role where role_name != "超级管理员"');
    let result = await db.select('t_role');
    result = ctx.camelcaseKeys(result);
    return result;
  }

  async getAllRoleList() {
    const { ctx, app } = this;
    const db = app.mysql.get('spring');
    let result = await db.select('t_role');
    result = ctx.camelcaseKeys(result);
    return result;
  }
}

module.exports = RoleService;
